using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.Configuration;
using XCode.DataAccessLayer;

namespace Model.Xcode
{
    /// <summary></summary>
    [Serializable]
    [DataObject]
    [BindTable("T_SYS_DepartmentInfo", Description = "", ConnName = "DefaultDB", DbType = DatabaseType.SqlServer)]
    public partial class TSysDepartmentinfo : ITSysDepartmentinfo
    {
        #region 属性
        private Int32 _ID;
        /// <summary></summary>
        [DisplayName("ID")]
        [DataObjectField(false, false, false, 10)]
        [BindColumn("ID", "", "int")]
        public Int32 ID { get => _ID; set { if (OnPropertyChanging(__.ID, value)) { _ID = value; OnPropertyChanged(__.ID); } } }

        private String _ParentID;
        /// <summary></summary>
        [DisplayName("ParentID")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("ParentID", "", "nvarchar(50)")]
        public String ParentID { get => _ParentID; set { if (OnPropertyChanging(__.ParentID, value)) { _ParentID = value; OnPropertyChanged(__.ParentID); } } }

        private String _Code;
        /// <summary></summary>
        [DisplayName("Code")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Code", "", "nvarchar(50)")]
        public String Code { get => _Code; set { if (OnPropertyChanging(__.Code, value)) { _Code = value; OnPropertyChanged(__.Code); } } }

        private String _Name;
        /// <summary></summary>
        [DisplayName("Name")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Name", "", "nvarchar(50)", Master = true)]
        public String Name { get => _Name; set { if (OnPropertyChanging(__.Name, value)) { _Name = value; OnPropertyChanged(__.Name); } } }

        private String _FullName;
        /// <summary></summary>
        [DisplayName("FullName")]
        [DataObjectField(false, false, true, 100)]
        [BindColumn("FullName", "", "nvarchar(100)")]
        public String FullName { get => _FullName; set { if (OnPropertyChanging(__.FullName, value)) { _FullName = value; OnPropertyChanged(__.FullName); } } }

        private String _Description;
        /// <summary></summary>
        [DisplayName("Description")]
        [DataObjectField(false, false, true, 500)]
        [BindColumn("Description", "", "nvarchar(500)")]
        public String Description { get => _Description; set { if (OnPropertyChanging(__.Description, value)) { _Description = value; OnPropertyChanged(__.Description); } } }

        private Boolean _IsDisabled;
        /// <summary></summary>
        [DisplayName("IsDisabled")]
        [DataObjectField(false, false, true, 0)]
        [BindColumn("IsDisabled", "", "bit")]
        public Boolean IsDisabled { get => _IsDisabled; set { if (OnPropertyChanging(__.IsDisabled, value)) { _IsDisabled = value; OnPropertyChanged(__.IsDisabled); } } }

        private Int32 _Sequence;
        /// <summary></summary>
        [DisplayName("Sequence")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn("Sequence", "", "int")]
        public Int32 Sequence { get => _Sequence; set { if (OnPropertyChanging(__.Sequence, value)) { _Sequence = value; OnPropertyChanged(__.Sequence); } } }

        private DateTime _CreateAt;
        /// <summary></summary>
        [DisplayName("CreateAt")]
        [DataObjectField(false, false, true, 3)]
        [BindColumn("CreateAt", "", "datetime", Precision = 0, Scale = 3)]
        public DateTime CreateAt { get => _CreateAt; set { if (OnPropertyChanging(__.CreateAt, value)) { _CreateAt = value; OnPropertyChanged(__.CreateAt); } } }

        private DateTime _UpdateAt;
        /// <summary></summary>
        [DisplayName("UpdateAt")]
        [DataObjectField(false, false, true, 3)]
        [BindColumn("UpdateAt", "", "datetime", Precision = 0, Scale = 3)]
        public DateTime UpdateAt { get => _UpdateAt; set { if (OnPropertyChanging(__.UpdateAt, value)) { _UpdateAt = value; OnPropertyChanged(__.UpdateAt); } } }

        private Int32 _HrParentID;
        /// <summary></summary>
        [DisplayName("HrParentID")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn("HrParentID", "", "int")]
        public Int32 HrParentID { get => _HrParentID; set { if (OnPropertyChanging(__.HrParentID, value)) { _HrParentID = value; OnPropertyChanged(__.HrParentID); } } }

        private String _OldHrDeptGuid;
        /// <summary></summary>
        [DisplayName("OldHrDeptGuid")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("OldHrDeptGuid", "", "nvarchar(50)")]
        public String OldHrDeptGuid { get => _OldHrDeptGuid; set { if (OnPropertyChanging(__.OldHrDeptGuid, value)) { _OldHrDeptGuid = value; OnPropertyChanged(__.OldHrDeptGuid); } } }

        private Int32 _DeptAid;
        /// <summary></summary>
        [DisplayName("DeptAid")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn("Dept_AID", "", "int")]
        public Int32 DeptAid { get => _DeptAid; set { if (OnPropertyChanging(__.DeptAid, value)) { _DeptAid = value; OnPropertyChanged(__.DeptAid); } } }

        private String _DeptBid;
        /// <summary></summary>
        [DisplayName("DeptBid")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Dept_BID", "", "nvarchar(50)")]
        public String DeptBid { get => _DeptBid; set { if (OnPropertyChanging(__.DeptBid, value)) { _DeptBid = value; OnPropertyChanged(__.DeptBid); } } }

        private String _DeptID;
        /// <summary></summary>
        [DisplayName("DeptID")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Dept_ID", "", "nvarchar(50)")]
        public String DeptID { get => _DeptID; set { if (OnPropertyChanging(__.DeptID, value)) { _DeptID = value; OnPropertyChanged(__.DeptID); } } }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.ID: return _ID;
                    case __.ParentID: return _ParentID;
                    case __.Code: return _Code;
                    case __.Name: return _Name;
                    case __.FullName: return _FullName;
                    case __.Description: return _Description;
                    case __.IsDisabled: return _IsDisabled;
                    case __.Sequence: return _Sequence;
                    case __.CreateAt: return _CreateAt;
                    case __.UpdateAt: return _UpdateAt;
                    case __.HrParentID: return _HrParentID;
                    case __.OldHrDeptGuid: return _OldHrDeptGuid;
                    case __.DeptAid: return _DeptAid;
                    case __.DeptBid: return _DeptBid;
                    case __.DeptID: return _DeptID;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.ID: _ID = value.ToInt(); break;
                    case __.ParentID: _ParentID = Convert.ToString(value); break;
                    case __.Code: _Code = Convert.ToString(value); break;
                    case __.Name: _Name = Convert.ToString(value); break;
                    case __.FullName: _FullName = Convert.ToString(value); break;
                    case __.Description: _Description = Convert.ToString(value); break;
                    case __.IsDisabled: _IsDisabled = value.ToBoolean(); break;
                    case __.Sequence: _Sequence = value.ToInt(); break;
                    case __.CreateAt: _CreateAt = value.ToDateTime(); break;
                    case __.UpdateAt: _UpdateAt = value.ToDateTime(); break;
                    case __.HrParentID: _HrParentID = value.ToInt(); break;
                    case __.OldHrDeptGuid: _OldHrDeptGuid = Convert.ToString(value); break;
                    case __.DeptAid: _DeptAid = value.ToInt(); break;
                    case __.DeptBid: _DeptBid = Convert.ToString(value); break;
                    case __.DeptID: _DeptID = Convert.ToString(value); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得TSysDepartmentinfo字段信息的快捷方式</summary>
        public partial class _
        {
            /// <summary></summary>
            public static readonly Field ID = FindByName(__.ID);

            /// <summary></summary>
            public static readonly Field ParentID = FindByName(__.ParentID);

            /// <summary></summary>
            public static readonly Field Code = FindByName(__.Code);

            /// <summary></summary>
            public static readonly Field Name = FindByName(__.Name);

            /// <summary></summary>
            public static readonly Field FullName = FindByName(__.FullName);

            /// <summary></summary>
            public static readonly Field Description = FindByName(__.Description);

            /// <summary></summary>
            public static readonly Field IsDisabled = FindByName(__.IsDisabled);

            /// <summary></summary>
            public static readonly Field Sequence = FindByName(__.Sequence);

            /// <summary></summary>
            public static readonly Field CreateAt = FindByName(__.CreateAt);

            /// <summary></summary>
            public static readonly Field UpdateAt = FindByName(__.UpdateAt);

            /// <summary></summary>
            public static readonly Field HrParentID = FindByName(__.HrParentID);

            /// <summary></summary>
            public static readonly Field OldHrDeptGuid = FindByName(__.OldHrDeptGuid);

            /// <summary></summary>
            public static readonly Field DeptAid = FindByName(__.DeptAid);

            /// <summary></summary>
            public static readonly Field DeptBid = FindByName(__.DeptBid);

            /// <summary></summary>
            public static readonly Field DeptID = FindByName(__.DeptID);

            static Field FindByName(String name) => Meta.Table.FindByName(name);
        }

        /// <summary>取得TSysDepartmentinfo字段名称的快捷方式</summary>
        public partial class __
        {
            /// <summary></summary>
            public const String ID = "ID";

            /// <summary></summary>
            public const String ParentID = "ParentID";

            /// <summary></summary>
            public const String Code = "Code";

            /// <summary></summary>
            public const String Name = "Name";

            /// <summary></summary>
            public const String FullName = "FullName";

            /// <summary></summary>
            public const String Description = "Description";

            /// <summary></summary>
            public const String IsDisabled = "IsDisabled";

            /// <summary></summary>
            public const String Sequence = "Sequence";

            /// <summary></summary>
            public const String CreateAt = "CreateAt";

            /// <summary></summary>
            public const String UpdateAt = "UpdateAt";

            /// <summary></summary>
            public const String HrParentID = "HrParentID";

            /// <summary></summary>
            public const String OldHrDeptGuid = "OldHrDeptGuid";

            /// <summary></summary>
            public const String DeptAid = "DeptAid";

            /// <summary></summary>
            public const String DeptBid = "DeptBid";

            /// <summary></summary>
            public const String DeptID = "DeptID";
        }
        #endregion
    }

    /// <summary>接口</summary>
    public partial interface ITSysDepartmentinfo
    {
        #region 属性
        /// <summary></summary>
        Int32 ID { get; set; }

        /// <summary></summary>
        String ParentID { get; set; }

        /// <summary></summary>
        String Code { get; set; }

        /// <summary></summary>
        String Name { get; set; }

        /// <summary></summary>
        String FullName { get; set; }

        /// <summary></summary>
        String Description { get; set; }

        /// <summary></summary>
        Boolean IsDisabled { get; set; }

        /// <summary></summary>
        Int32 Sequence { get; set; }

        /// <summary></summary>
        DateTime CreateAt { get; set; }

        /// <summary></summary>
        DateTime UpdateAt { get; set; }

        /// <summary></summary>
        Int32 HrParentID { get; set; }

        /// <summary></summary>
        String OldHrDeptGuid { get; set; }

        /// <summary></summary>
        Int32 DeptAid { get; set; }

        /// <summary></summary>
        String DeptBid { get; set; }

        /// <summary></summary>
        String DeptID { get; set; }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}